package com.ruoyi.core.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.core.mapper.StockChangeLogMapper;
import com.ruoyi.core.domain.StockChangeLog;
import com.ruoyi.core.service.IStockChangeLogService;

/**
 * 库存变动日志Service业务层处理
 * 
 * @author yfk
 * @date 2025-08-07
 */
@Service
public class StockChangeLogServiceImpl implements IStockChangeLogService 
{
    @Autowired
    private StockChangeLogMapper stockChangeLogMapper;

    /**
     * 查询库存变动日志
     * 
     * @param id 库存变动日志主键
     * @return 库存变动日志
     */
    @Override
    public StockChangeLog selectStockChangeLogById(Long id)
    {
        return stockChangeLogMapper.selectStockChangeLogById(id);
    }

    /**
     * 查询库存变动日志列表
     * 
     * @param stockChangeLog 库存变动日志
     * @return 库存变动日志
     */
    @Override
    public List<StockChangeLog> selectStockChangeLogList(StockChangeLog stockChangeLog)
    {
        return stockChangeLogMapper.selectStockChangeLogList(stockChangeLog);
    }

    /**
     * 新增库存变动日志
     * 
     * @param stockChangeLog 库存变动日志
     * @return 结果
     */
    @Override
    public int insertStockChangeLog(StockChangeLog stockChangeLog)
    {
        stockChangeLog.setCreateTime(DateUtils.getNowDate());
        return stockChangeLogMapper.insertStockChangeLog(stockChangeLog);
    }

    /**
     * 修改库存变动日志
     * 
     * @param stockChangeLog 库存变动日志
     * @return 结果
     */
    @Override
    public int updateStockChangeLog(StockChangeLog stockChangeLog)
    {
        return stockChangeLogMapper.updateStockChangeLog(stockChangeLog);
    }

    /**
     * 批量删除库存变动日志
     * 
     * @param ids 需要删除的库存变动日志主键
     * @return 结果
     */
    @Override
    public int deleteStockChangeLogByIds(Long[] ids)
    {
        return stockChangeLogMapper.deleteStockChangeLogByIds(ids);
    }

    /**
     * 删除库存变动日志信息
     * 
     * @param id 库存变动日志主键
     * @return 结果
     */
    @Override
    public int deleteStockChangeLogById(Long id)
    {
        return stockChangeLogMapper.deleteStockChangeLogById(id);
    }
}
